﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using OA.Model;
using OA.Business;
using System.Collections;

namespace ICement_Buying.Ajax
{
    /// <summary>
    /// HandlerProduct 的摘要说明
    /// </summary>
    public class HandlerProduct : MyCement.Utility.Web.HandlerBase
    {
        IProductBusiness ProBll = (new ProductBusinessFactory()).CreateProductBusiness();
        Hashtable hashtable = new Hashtable();
        IList<Product> _produts = new List<Product>();
        public override void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            if (IsGet)
            {
                int cateId = QueryParamInt32("cateId");
                hashtable.Add(Em_Product.subcateId, cateId);
                hashtable.Add(Em_Product.TopNum, 8);
                _produts = ProBll.GetRecords(hashtable);
                foreach (Product item in _produts)
                {
                    item.main_param = "";
                    item.detail_param = "";
                }
                string str = MyCement.Utils.Json.ToJson<Product>(_produts);
                context.Response.Write(str);
            }
        }
    }
}